home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr40 / x1j4_src.zip / ALL.H next >
Text File  |  1995-02-03  |  13KB  |  303 lines

  1. /**************************************************************************\
  2. *                                                                          *
  3. *                                                                          *
  4. *    *****                      *****                                      *
  5. *      *****                  *****                                        *
  6. *        *****              *****                                          *
  7. *          *****          *****                                            *
  8. *            *****      *****                                              *
  9. *              *****  *****                                                *
  10. *            *****      *****                                              *
  11. *          *****          *****          The Firmware. The Net.            *
  12. *        *****              *****        Portable. Compatible.             *
  13. *      *****                  *****      Public Domain.                    *
  14. *    *****                      *****    By NORD><LINK.                    *
  15. *                                                                          *
  16. *                                                                          *
  17. *                                                                          *
  18. *    ALL.H   -   Headerfile fuer alle C-Sources                            *
  19. *                                                                          *
  20. *    angelegt:      DC4OX                                                  *
  21. *    modifiziert:                                                          *
  22. *                                                                          *
  23. *    G8KBB - April 91 - remove defintion of FIRMWARE                        *
  24. *         - add definitions for ESDG_RING                                  *
  25. \**************************************************************************/
  26.  
  27. /*
  28.  * Released as TheNet X-1J release 4, January 1995
  29.  */
  30.  
  31. /* bit of a crock - need to include compile time switch definitions
  32.  * from version.h. Note compiler difference. MSC goes & looks in the
  33.  * wrong place !
  34.  */
  35.  
  36. #ifdef MSDOS
  37. #include "pc\version.h"
  38. #else 
  39. #include "version.h"
  40. #endif
  41.  
  42. /*                                                         Festlegungen   */
  43. /**************************************************************************/
  44.  
  45. #ifdef FIRMWARE
  46. #define LINKNMBR     4        /* maximale Anzahl Links = Connect-Kanaele  */
  47. #else
  48. #define LINKNMBR    25
  49. #endif
  50.  
  51. #define TRUE        1         /* BOOLEAN TRUE                             */
  52. #define FALSE       0         /* BOOLEAN FALSE                            */
  53. #define YES         1         /* TRUE-Synonym                             */
  54. #define NO          0         /* FALSE-Synonym                            */
  55. #define ERROR       (-1)      /* Fehler                                   */
  56. #define LOOP        for(;;)   /* Endlosschleife                           */
  57. #define STACKLEN    384       /* Anzahl Bytes fuer Systemstack            */
  58. #define MAGIC       0x4D5A    /* "magic number", Warmstartfeststellung    */
  59.                               /* (MSDOS laesst gruessen ...)              */
  60.  
  61. #define L2PNUM      NUMPORTS            /* L2x.C :   Level-2-Port numbers */
  62.  
  63. #define NULL        0         /* leerer Inhalt, leerer Zeiger,            */
  64.                               /* sollte bei 8-Bit-Systemen 0, bei 16-Bit- */
  65.                               /* Systemen 0L heissen, 0L weil NULL auch   */
  66.                               /* als Parameter moeglich ist, 0L bei       */
  67.                               /* 8-Bit-Systemen kann aber dazu fuehren,   */
  68.                               /* dass die 32-Bit-Bibliothek geladen wird, */
  69.                               /* ohne dass sie benutzt wird               */
  70.  
  71.  
  72.  
  73. /*                                                       einfache Typen   */
  74. /**************************************************************************/
  75.  
  76. typedef int        VOID;      /* Keine-Parameter-Zurueck-Funktion         */
  77. typedef unsigned   BOOLEAN;   /* 1 = TRUE, 0 = FALSE                      */
  78.  
  79. #ifdef MONITORCMD
  80. #define MAXHEARDLIST 100
  81. #ifndef MODIFIED
  82. #define MODIFIED
  83. #endif
  84. #endif
  85.  
  86. #ifdef STATSCMD
  87. #define NUM1STATS 6
  88. /* WARNING !
  89.  * If you change this you may need to alter tnl1.mac as it
  90.  * offsets into this table for rxovr, txund and rxcrc
  91.  */
  92. #define NUML2STATS 11
  93. #define L2HDCNT l2stats[0]
  94. #define L2RXCNT l2stats[1]
  95. #define L2TXCNT l2stats[2]
  96. #define L2RXRNR l2stats[3]
  97. #define L2RXREJ l2stats[4]
  98. #define L2TXRNR l2stats[5]
  99. #define L2TXREJ l2stats[6]
  100. #define L2FAILS l2stats[7]
  101. #define L2RXOVR l2stats[8]
  102. #define L2TXUND l2stats[9]
  103. #define L2RXCRC l2stats[10]
  104.  
  105. #define NUML4STATS 2
  106. #define L4TXCNT l4stats[0]
  107. #define L4RXCNT l4stats[1]
  108. #ifndef MODIFIED
  109. #define MODIFIED
  110. #endif
  111. #endif
  112.  
  113. #ifdef HOSTMODE
  114. #define HOSTCMD
  115. #ifndef MODIFIED
  116. #define MODIFIED
  117. #endif
  118. #endif
  119.  
  120. #ifndef SIGNONTEXT
  121. #define SIGNONTEXT "TheNet 1.01 "
  122. #endif
  123.  
  124. #ifdef FIRMWARE
  125. #define INCLUDEcpyfb
  126. #else
  127. #ifdef KISSMODE
  128. #define INCLUDEcpyfb
  129. #endif
  130. #endif /* FIRMWARE */
  131.  
  132. #ifdef ACL
  133. #define ACL_BAR_L2_IC 1
  134. #define ACL_BAR_L2_OG 2
  135. #define ACL_BAR_L3_BCASTS 4
  136. #define ACL_BAR_L3_RELAY 8
  137. #define ACL_BAR_L4_IC 0x10
  138. #define ACL_BAR_L4_OG 0x20
  139. #define ACL_IGNORE_SSID 0x40
  140. #ifdef ACL_DISCMD_OVERRIDE
  141. #define ACL_DIS_OVERRIDE 0x80
  142. #endif
  143. #endif
  144.  
  145.  
  146. #ifdef METERS
  147. /* The following apply to meterflags variable
  148.  */
  149. #define DEVMETER_ENABLE    1
  150. #define SMETER_ENABLE 2
  151. #define SMETER_AS_S 4
  152. #define CH3_ENABLE 8
  153. #define CH4_ENABLE 0x10
  154. #define CH3_DIV1000 0x20
  155. #define CH4_DIV1000 0x40
  156. #define CH3_DECIMALS 0x80
  157. #define CH4_DECIMALS 0x100
  158. #ifdef ALL_METERS
  159. #define CH1_ENABLE 0x200
  160. #define CH2_ENABLE 0x400
  161. #define CH1_DIV1000 0x800
  162. #define CH2_DIV1000 0x1000
  163. #define CH1_DECIMALS 0x2000
  164. #define CH2_DECIMALS 0x4000
  165. #endif
  166. #endif
  167.  
  168. #ifdef CWID
  169. #define CWIDLEN    6
  170. #endif
  171.  
  172. #define BLINLEN 100        /* length of host port line buffer */
  173.  
  174. /* WARNING - the non portable versions here are macros not functions
  175.  * so fairly predictable nasties may happen in predicable 'C' way if
  176.  * you are careless with their parameters.
  177.  */
  178. #ifndef PORTABLE
  179. #define cpy6ch( dest, src ) memcpy( (dest), (src), 6 )
  180. #define move4b( count, dest, src ) memcpy( (dest), (src), (count)*4 )
  181. #endif
  182.  
  183. /* Ende von ALL.H */
  184.  
  185. /* residue of tndef.h */
  186.  
  187. # define NUMCIR   20        /* Laenge der Circuit Tabelle             */
  188. # define NUMPAT   46        /* Laenge der Patchcord Liste             */
  189. # define MAXL2L   LINKNMBR    /* Links im Level2                 */
  190. # define MAXHST       1        /* Host Kanaele                     */
  191. # define DEFL2L    1        /* Protokollversion 2                 */
  192.  
  193. /* definition of PIDs as follows :
  194.  */
  195. #define PID_IP        0xcc
  196. #define PID_ARP        0xcd
  197. #define PID_FLEXNET    0xce
  198. #define PID_NETROM    0xcf
  199. #define PID_NO_L3    0xf0
  200. #define PID_TEXNET 0xc3
  201.  
  202. #define NR4_OP_PID      0
  203. #define NR_PROTO_IP     0x0c
  204.  
  205. /* end of tndef.h */
  206.  
  207. /* the following are from l2.h */
  208.  
  209.  
  210.  
  211.  
  212. #define L2CALEN  6                      /* Laenge Call im Level 2         */
  213. #define L2IDLEN  (L2CALEN + 1)          /* Laenge Call + SSID = ID        */
  214. #define L2INUM   2                      /* Anzahl ID's im an/von-Feld     */
  215. #define L2VNUM   8                      /* Anzahl ID's im via-Feld        */
  216. #define L2ILEN   (L2INUM * L2IDLEN)     /* Laenge an/von-Feld             */
  217. #define L2VLEN   (L2VNUM * L2IDLEN)     /* Laenge via-Feld                */
  218. #define L2AFLEN  (L2ILEN + L2VLEN)      /* Laenge Level 2 Adressfeld      */
  219. #define L2MFLEN  328                    /* maximale Framelaenge,          */
  220.                                         /*   10 * 7 =    70 Bytes Adresse */
  221.                                         /*            +   1 Byte Control  */
  222.                                         /*            +   1 Byte PID      */
  223.                                         /*            + 256 Byte Info     */
  224.                                         /*            -----               */
  225.                                         /*              328               */
  226.  
  227.  
  228.  
  229.                               /* "layer 2 state", (state, s.u.) :         */
  230. #define L2SDSCED    0         /*    disconnected                          */
  231. #define L2SLKSUP    1         /*    link setup                            */
  232. #define L2SFRREJ    2         /*    frame reject                          */
  233. #define L2SDSCRQ    3         /*    disconnect request                    */
  234. #define L2SIXFER    4         /*    information transfer                  */
  235. #define L2SRS       5         /*    REJ sent                              */
  236. #define L2SWA       6         /*    waiting acknowledge                   */
  237. #define L2SDBS      7         /*    device busy                           */
  238. #define L2SRBS      8         /*    remote busy                           */
  239. #define L2SBBS      9         /*    both busy                             */
  240. #define L2SWADBS   10         /*    waiting ack and device busy           */
  241. #define L2SWARBS   11         /*    waiting ack and remote busy           */
  242. #define L2SWABBS   12         /*    waiting ack and both busy             */
  243. #define L2SRSDBS   13         /*    REJ sent and device busy              */
  244. #define L2SRSRBS   14         /*    REJ sent and remote busy              */
  245. #define L2SRSBBS   15         /*    REJ sent and both busy                */
  246.  
  247.  
  248.  
  249.                               /* "layer 2 message", Status vom Level 2 :  */
  250. #define L2MNIX     0          /*    keine Nachricht                       */
  251. #define L2MCONNT   1          /*    CONNECTED to                          */
  252. #define L2MDISCF   2          /*    DISCONNECTED from                     */
  253. #define L2MBUSYF   3          /*    BUSY from                             */
  254. #define L2MFAILW   4          /*    LINK FAILURE with                     */
  255. #define L2MLRESF   5          /*    LINK RESET from                       */
  256. #define L2MLREST   6          /*    LINK RESET to                         */
  257. #define L2MFRMRF   7          /*    FRAME REJECT from                     */
  258. #define L2MFRMRT   8          /*    FRAME REJECT to                       */
  259. #define L2MBUSYT   9          /*    BUSY to                               */
  260.  
  261.  
  262.  
  263.                               /* "layer 2 control", Frametypen :          */
  264.                               /*                                          */
  265.                               /*                       Command/   Poll/   */
  266.                               /*    Typ       Gruppe   Response   Final   */
  267.                               /* ---------------------------------------- */
  268. #define L2CI       0x00       /*      I         I         C         P     */
  269. #define L2CUI      0x03       /*     UI         U        C/R       P/F    */
  270. #define L2CSABM    0x2F       /*   SABM         U         C         P     */
  271. #define L2CDISC    0x43       /*   DISC         U         C         P     */
  272. #define L2CUA      0x63       /*     UA         U         R         F     */
  273. #define L2CDM      0x0F       /*     DM         U         R         F     */
  274. #define L2CFRMR    0x87       /*   FRMR         U         R         F     */
  275. #define L2CRR      0x01       /*     RR         S        C/R       P/F    */
  276. #define L2CREJ     0x09       /*    REJ         S        C/R       P/F    */
  277. #define L2CRNR     0x05       /*    RNR         S        C/R       P/F    */
  278.  
  279.                               /* "layer 2 control", spezielle Bits :      */
  280. #define L2CPF      0x10       /*   Poll/Final                             */
  281. #define L2CCR      0x80       /*   Command/Response                       */
  282. #define L2CH       0x80       /*   "has been repeated"                    */
  283. #define L2CEOA     0x01       /*   End of Address                         */
  284.  
  285.                               /* "layer 2 control", Masken :              */
  286. #define L2CNOIM    0x01       /*   "no I mask", kein I-Frame              */
  287. #define L2CNOSM    0x02       /*   "no S mask", kein S-Frame              */
  288.  
  289.                               /* "layer 2 control", Protokollidentifier   */
  290. #define L2CPID     PID_NO_L3  /*   PID                                    */
  291.  
  292.                               /* "layer 2 control", Flags (flag, s.u.) :  */
  293. #define L2FL3LNK   0x20       /*   Link ist Layer-3-Link                  */
  294. #define L2FBUSY    0x40       /*   Device busy (ich !)                    */
  295. #define L2FDSLE    0x80       /*   "disc if send list empty"              */
  296.  
  297.                               /* im Framebufferkopf (l2fflag, s.u.) :     */
  298. #define L2FT1ST    0x01       /*   nach Aussendung ist T1 zu starten      */
  299. #define L2FUS      0x02       /*   Sendeframe ist U- oder S-Frame (nicht  */
  300.                               /*   digipeatet)                            */
  301.  
  302.  
  303.